<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" 
           %><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"
           %><%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"
           %><%@ taglib tagdir="/WEB-INF/tags" prefix="cohesion"
           %><%@ page contentType="text/html;charset=ISO-8859-1"
           %><html:html>
    <head>
        <title><bean:message key="VTarea.title"/></title>
        <html:base/>
        <%@include file="../header/include.jsp" %>


    </head>
    <body>
        <div id="header"  class="ui-widget-header ui-corner-all">
            <h1><bean:message key="all.title"/></h1>
            <div id="menu">
                <%--    <ul id="nav">
                        <li><html:link action="/APreEditarTarea.do" paramId="idTarea" paramName="Tarea" paramProperty="idTarea"><bean:message key="VTarea.label0"/> Editar </html:link></li>
                        <li><html:link action="/AEliminarTarea.do" paramId="idTarea" paramName="Tarea" paramProperty="idTarea"><bean:message key="VTarea.label1"/> Eliminar </html:link></li>
                        <li><html:link action="/APreTareas.do"><bean:message key="VTarea.label2"/> Volver </html:link></li>

                </ul>
                --%></div>
        </div>
        <div id="body_wrapper">
            <div id="body">
                <div id="split">
                    <div class="top"></div>
                    <div id="left">
                        <div id="content">
                            <div class="ui-widget-header ui-corner-top "> <h1> Tarea </h1></div>
                            <script type="text/javascript">
                                $(function() {
                                    $("#tabs").tabs();
                                });
                            </script>

                            <div id="tabs">
                                <ul>
                                    <li><a href="#tabs-1">Datos Generales</a></li>
                                    <li><a href="#tabs-2">Comentarios</a></li>
                                </ul>



                                <div  class="ui-widget-content ui-widget">
                                    <div id="tabs-1">
                                        <div style="float: right;margin: 1% 1% 1% 1%; clear: left;">
                                            <ul class="sf_admin_td_actions fg-buttonset fg-buttonset-single">
                                                <cohesion:actor actors="5"><li class="sf_admin_action_usuario"><html:link action="/APreEditarTarea.do" paramId="idTarea" paramName="Tarea" paramProperty="idTarea" styleClass="fg-button-mini fg-button ui-state-default fg-button-icon-left"><span class="ui-icon ui-icon-pencil"></span>Editar Tarea</html:link></li></cohesion:actor>
                                                <cohesion:actor actors="1"><li class="sf_admin_action_usuario"><html:link action="/AEliminarTarea.do" paramId="idTarea" paramName="Tarea" paramProperty="idTarea" styleClass="fg-button-mini fg-button ui-state-default fg-button-icon-left"><span class="ui-icon ui-icon-trash"></span>Eliminar Tarea</html:link></li></cohesion:actor>
                                                <cohesion:actor actors="5"><li class="sf_admin_action_usuario"><html:link action="/APreTareas.do" styleClass="fg-button-mini fg-button ui-state-default fg-button-icon-left"><span class="ui-icon ui-icon-arrowreturnthick-1-w"></span>Ir a Tareas</html:link></li></cohesion:actor>
                                            </ul>
                                        </div>

                                        <div class="show ui-grid-table ui-widget ui-corner-all ui-helper-reset ui-helper-clearfix">

                                            <table>
                                                <tr>
                                                    <th class="atributos ui-state-default ui-th-column" colspan="2" style="text-align: center;">Datos de la Tarea</th>
                                                </tr>
                                                <tr>
                                                    <th class="atributos ui-state-default ui-th-column">Encargado</th>
                                                    <td class="valor sf_admin_row ui-widget-content"><html:link action="/APreUsuario.do" paramId="idUsuario" paramName="Personal" paramProperty="idPersonal"> ${Personal.nombre} </html:link></td>
                                                </tr>
                                                <tr>
                                                    <th  class="atributos ui-state-default ui-th-column">Asunto</th>
                                                    <td class="valor sf_admin_row ui-widget-content">${Tarea.asunto}</td>
                                                </tr>
                                                <tr>
                                                    <th  class="atributos ui-state-default ui-th-column">Descripci&oacute;n</th>
                                                    <td class="valor sf_admin_row ui-widget-content">${Tarea.descripcion}</td>
                                                </tr>
                                                <tr>
                                                    <th  class="atributos ui-state-default ui-th-column">Fecha Vencimiento</th>
                                                    <td class="valor sf_admin_row ui-widget-content">${Tarea.fechaVencimiento}</td>
                                                </tr>
                                                <tr>
                                                    <th  class="atributos ui-state-default ui-th-column">Cuenta Relacionada</th>
                                                    <td class="valor sf_admin_row ui-widget-content"> <logic:notEmpty name="Cuenta"> <html:link action="/APreCuenta.do" paramId="idCuenta" paramName="Cuenta" paramProperty="idCuenta">  ${Cuenta.nombre} </html:link> </logic:notEmpty></td>
                                                </tr>
                                                <tr>
                                                    <th  class="atributos ui-state-default ui-th-column">Nombre Contacto</th>
                                                    <td class="valor sf_admin_row ui-widget-content"><logic:notEmpty name="Contacto">
                                                            <logic:equal name="Contacto" property="esCliente" value="true">
                                                                <html:link action="/APreCliente.do" paramId="idCliente" paramName="Contacto" paramProperty="idContacto"> ${Contacto.nombre}</html:link>
                                                            </logic:equal>
                                                            <logic:equal name="Contacto" property="esCliente" value="false">
                                                                <html:link action="/APreContacto.do" paramId="idContacto" paramName="Contacto" paramProperty="idContacto"> ${Contacto.nombre}</html:link>
                                                            </logic:equal>

                                                        </logic:notEmpty> </td>
                                                </tr>
                                                <tr>
                                                    <th  class="atributos ui-state-default ui-th-column">Prioridad</th>
                                                    <td class="valor sf_admin_row ui-widget-content">${Tarea.prioridad.nombre}</td>
                                                </tr>
                                                <tr>
                                                    <th  class="atributos ui-state-default ui-th-column">Telefono</th>
                                                    <td class="valor sf_admin_row ui-widget-content">${Tarea.telefono}</td>
                                                </tr>
                                                <tr>
                                                    <th  class="atributos ui-state-default ui-th-column">Correo Electronico</th>
                                                    <td class="valor sf_admin_row ui-widget-content">${Tarea.correoElectronico}</td>
                                                </tr>
                                                <tr>
                                                    <th  class="atributos ui-state-default ui-th-column">Oportunidad Relacionada</th>
                                                    <td class="valor sf_admin_row ui-widget-content">${Tarea.oportunidadRelacionada.nombre}</td>
                                                </tr>
                                                <tr>
                                                    <th  class="atributos ui-state-default ui-th-column">Estado</th>
                                                    <td class="valor sf_admin_row ui-widget-content">${Tarea.estado.nombre}</td>
                                                </tr>

                                            </table>

                                        </div>
                                    </div>
                                    <div id="tabs-2">

                                        <div class="list ui-grid-table ui-widget ui-corner-all ui-helper-reset ui-helper-clearfix">
                                            <display:table name="L_Comentarios" requestURI="/APreTareas.do" pagesize="10"  class="display-tag-tarea" htmlId="display-tag-tarea" id="comentario">
                                                <display:column property="fecha" title="Fecha" sortable="true"/>
                                                <display:column property="personal.nombre" title="Personal" sortable="true"/>
                                                <display:column property="comentario" title="Comentario" sortable="true" />
                                                <display:column title="Acciones">
                                                    <ul class="sf_admin_td_actions fg-buttonset fg-buttonset-single">
                                                        <li class="sf_admin_action_delete"><html:link action="/AEliminarComentario.do" paramId="idComentario" paramName="comentario" paramProperty="idComentario" styleClass="fg-button-mini fg-button ui-state-default fg-button-icon-left"><span class="ui-icon ui-icon-trash"></span>Borrar</html:link>
                                                    </ul>
                                                </display:column>

                                            </display:table>

                                            <script>
                                                $(document).ready(function() {

                                                    $('table#display-tag-tarea thead').addClass('ui-widget-header');
                                                    $('table#display-tag-tarea thead tr th').addClass('ui-state-default ui-th-column');
                                                    $('table#display-tag-tarea tbody tr').addClass('sf_admin_row ui-widget-content odd');



                                                });
                                            </script>
                                        </div>
                                    </div>

                                    <!--                                    <table border="1" width="100%">



                                                                            <thead class="ui-widget-header">
                                                                                <tr>
                                                                                    <th class="atributos ui-state-default ui-th-column" colspan="4" style="text-align: center;">Comentarios</th>
                                                                                </tr>
                                                                                <tr>
                                                                                    <th class="ui-state-default ui-th-column" width="25%" style="text-align: center;">Fecha</th>
                                                                                    <th class="ui-state-default ui-th-column" width="25%" style="text-align: center;">Personal</th>
                                                                                    <th class="ui-state-default ui-th-column" width="25%" style="text-align: center;">Comentario</th>
                                                                                    <th class="ui-state-default ui-th-column" width="25%" height="10" style="text-align: center;">Acci&oacute;n</th>
                                                                                </tr>
                                                                            </thead>
                                                                            <tbody id="formularioTabla">
                                    <% request.setAttribute("_vacio", new Object[0]);%>
                                    <logic:iterate id="comentario" collection="${empty L_Comentarios ? _vacio : L_Comentarios }">
                                        <tr>
                                            <td class="ui-state-default ui-th-column">${comentario.fecha}</td>
                                            <td class="ui-state-default ui-th-column">${comentario.personal.nombre}</td>
                                            <td class="ui-state-default ui-th-column">${comentario.comentario}</td>
                                            <td class="ui-state-default ui-th-column">
                                                <ul class="sf_admin_td_actions fg-buttonset fg-buttonset-single">
                                                    <li class="sf_admin_action_show"><html:link action="/AEliminarComentario.do" paramId="idComentario" paramName="comentario" paramProperty="idComentario" styleClass="fg-button-mini fg-button ui-state-default fg-button-icon-left"><span class="ui-icon ui-icon-pencil"></span>Eliminar</html:link></li>
                                                </ul>
                                            </td>
                                        </tr>
                                    </logic:iterate>

                                </tbody>
                            </table>-->
                                </div>
                                <div id="form_container">
                                    <html:form
                                        action="/ACrearComentario.do" method="post" enctype="multipart/form-data">
                                        <div class="formRow <logic:notEmpty name="comentarioError"> ui-state-error ui-corner-all</logic:notEmpty>">
                                            <div class="labelRow">
                                                <label for="Comentario">Comentario</label>
                                            </div>
                                            <div class="inputRow">
                                                <html:textarea styleId="comentario" property="comentario" cols="100" rows="10"/>
                                            </div>
                                            <logic:notEmpty name="comentarioError">
                                                ${comentarioError}
                                            </logic:notEmpty>
                                        </div>

                                        <html:hidden property="idComentario"/>
                                        <html:hidden property="asociadoA"/>
                                        <html:hidden property="fecha"/>
                                        <html:hidden property="personal"/>
                                        <html:hidden property="categoria"/>

                                        <html:submit styleClass="fg-button-mini fg-button ui-state-default" style="padding: 5px 10px 5px 10px;">Guardar</html:submit>
                                    </html:form>
                                </div>

                            </div>
                        </div>
                    </div>
                    <div id="right">


                        <%@include file="../administrador/VMenuAdmin.jsp" %>
                    </div>
                    <div class="clearer ui-helper-clearfix"></div>
                    <div class="bottom"></div>
                </div>
                <div class="clearer"></div>
            </div>
            <div class="clearer"></div>
        </div>
        <div id="end_body"></div>
        <div id="footer"> <%@include file="/footer/include.jsp" %> </div>

    </body>
</html:html>